php array_map passing parameters

94

php array_map passing parameters -

function myarraymap($item,$item2) {
    return $item[$item2];
}

$param = 'some_value';

$ids = array_map(
    function($item) use ($param) { return myarraymap($item, $param); },
    $data['student_teacher']
);

Comments

Submit
0 Comments